package controllers.admin;

import controllers.admin.permission.AuthorityController;
import controllers.deadbolt.RestrictedResource;
import org.apache.commons.io.FileUtils;
import play.Play;
import play.modules.router.Get;

import java.io.File;
import java.io.IOException;
import java.util.List;

/**
 * Created by FireFire on 4/7 0007.
 */
@RestrictedResource(name="/tts/sys/log/index")
public class SysLogs extends AuthorityController{


    @Get("/tts/sys/log/index")
    public static void index() throws IOException {
        File file = Play.getFile("logs/audit.log");
        List<String> lines = FileUtils.readLines(file,"UTF-8");
        render(lines);
    }
}
